package com.saturdaycoder.volumeman;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class Preference {
	private static final String PREF_FILE = "pref";
	
	private static final String PREF_ACTIVE = "active";
	
	public static boolean getActive(Context context) {
		SharedPreferences pref = context.getSharedPreferences(PREF_FILE, Context.MODE_PRIVATE);
		return pref.getBoolean(PREF_ACTIVE, false);
	}
	
	public static void setActive(Context context, boolean b) {
		SharedPreferences pref = context.getSharedPreferences(PREF_FILE, Context.MODE_PRIVATE);
		Editor ed = pref.edit();
		ed.putBoolean(PREF_ACTIVE, b);
		ed.commit();
		
	}
}
